home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / vbasic / subvbx.exe / SUBVBX.CPP < prev    next >
C/C++ Source or Header  |  1993-04-29  |  4KB  |  135 lines

  1. // subvbx.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "subvbx.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "subvbdoc.h"
  9. #include "subvbvw.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CSubvbxApp
  18.  
  19. BEGIN_MESSAGE_MAP(CSubvbxApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CSubvbxApp)
  21.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code !
  24.     //}}AFX_MSG_MAP
  25.     // Standard file based document commands
  26.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  27.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CSubvbxApp construction
  32.  
  33. CSubvbxApp::CSubvbxApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CSubvbxApp object
  41.  
  42. CSubvbxApp NEAR theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CSubvbxApp initialization
  46.  
  47. BOOL CSubvbxApp::InitInstance()
  48. {
  49.     // Standard initialization
  50.     // If you are not using these features and wish to reduce the size
  51.     //  of your final executable, you should remove from the following
  52.     //  the specific initialization routines you do not need.
  53.  
  54.     SetDialogBkColor();        // set dialog background color to gray
  55.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  56.     EnableVBX();               // Initialize VBX support
  57.  
  58.     // Register the application's document templates.  Document templates
  59.     //  serve as the connection between documents, frame windows and views.
  60.  
  61.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  62.             RUNTIME_CLASS(CSubvbxDoc),
  63.             RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  64.             RUNTIME_CLASS(CSubvbxView)));
  65.  
  66.  
  67.     // create a new (empty) document
  68.     OnFileNew();
  69.  
  70.     if (m_lpCmdLine[0] != '\0')
  71.     {
  72.         // TODO: add command line processing here
  73.     }
  74.  
  75.     return TRUE;
  76. }
  77.  
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CAboutDlg dialog used for App About
  80.  
  81. class CAboutDlg : public CDialog
  82. {
  83. public:
  84.     CAboutDlg();
  85.  
  86. // Dialog Data
  87.     //{{AFX_DATA(CAboutDlg)
  88.     enum { IDD = IDD_ABOUTBOX };
  89.     //}}AFX_DATA
  90.  
  91. // Implementation
  92. protected:
  93.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  94.     //{{AFX_MSG(CAboutDlg)
  95.         // No message handlers
  96.     //}}AFX_MSG
  97.     DECLARE_MESSAGE_MAP()
  98. };
  99.  
  100. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  101. {
  102.     //{{AFX_DATA_INIT(CAboutDlg)
  103.     //}}AFX_DATA_INIT
  104. }
  105.  
  106. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  107. {
  108.     CDialog::DoDataExchange(pDX);
  109.     //{{AFX_DATA_MAP(CAboutDlg)
  110.     //}}AFX_DATA_MAP
  111. }
  112.  
  113. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  114.     //{{AFX_MSG_MAP(CAboutDlg)
  115.         // No message handlers
  116.     //}}AFX_MSG_MAP
  117. END_MESSAGE_MAP()
  118.  
  119. // App command to run the dialog
  120. void CSubvbxApp::OnAppAbout()
  121. {
  122.     CAboutDlg aboutDlg;
  123.     aboutDlg.DoModal();
  124. }
  125.  
  126. /////////////////////////////////////////////////////////////////////////////
  127. // VB-Event registration
  128. // (calls to AfxRegisterVBEvent will be placed here by ClassWizard)
  129.  
  130. //{{AFX_VBX_REGISTER_MAP()
  131. //}}AFX_VBX_REGISTER_MAP
  132.  
  133. /////////////////////////////////////////////////////////////////////////////
  134. // CSubvbxApp commands
  135.